USE [master]
GO

IF (select COUNT(Name) from sys.databases WHERE name = '$(DatabaseName)') = 0
BEGIN
	
	CREATE DATABASE [$(DatabaseName)] ON PRIMARY 
	( NAME = N'$(DatabaseName)_01', FILENAME = N'$(FilePath)\$(DatabaseName)_01.mdf' , SIZE = $(FileSize), FILEGROWTH = 10% )
	LOG ON
	( NAME = N'$(DatabaseName)_Log01', FILENAME = N'$(LogPath)\$(DatabaseName)_Log01.ldf' , SIZE = $(LogSize), FILEGROWTH = 10%)
	COLLATE Latin1_General_CI_AS_KS_WS

	ALTER DATABASE [$(DatabaseName)] SET RECOVERY $(RecoveryMode)
	
	--http://technet.microsoft.com/en-us/library/cc298801.aspx
	ALTER DATABASE [$(DatabaseName)] SET AUTO_CREATE_STATISTICS OFF
	ALTER DATABASE [$(DatabaseName)] SET AUTO_UPDATE_STATISTICS OFF
END

GO
